package com.testfileupload.uploadimg.design.proxy.dynamic.dc1;

import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;

public class GamePlayIH implements InvocationHandler {
    //被代理者
    Class cls =null;
    //被代理的实例
    Object obj = null;
    //代理谁
    public GamePlayIH(Object obj){
        this.obj = obj;
    }


    @Override
    public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
        Object invoke = method.invoke(this.obj, args);
        if (method.getName().equalsIgnoreCase("login")){
            System.out.println("号被盗");
        }
        return invoke;
    }
}
